package com.forevershine.business.persistent.impl;

import org.apache.ibatis.session.SqlSession;

import com.forevershine.business.model.Trim;
import com.forevershine.business.persistent.IDataAccessor;
import com.forevershine.business.persistent.TrimDao;

public class TrimDaoImpl implements TrimDao {

	@Override
	public Trim loadTrim(IDataAccessor dataAccessor, int taskId) {
		SqlSession session = dataAccessor.getSession();
		return (Trim)session.selectOne("selectTrim", taskId);
	}
	
	
	@Override
	public void insertTrim(IDataAccessor dataAccessor, Trim trim) {
		SqlSession session = dataAccessor.getSession();
		session.insert("insertTrim", trim);
		session.commit();
	}

}
